﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace MOSSPH
{
    public struct CrawlUrl
    {
        public string Url;
        public DateTime LastModified;

        public CrawlUrl(string url, DateTime lastModified)
        {
            Url = url;
            LastModified = lastModified;
        }

        public bool IsEmpty
        {
            get
            {
                if (string.IsNullOrEmpty(Url))
                    return true;
                else
                    return false;
            }
        }
    }
    
    public class Property
    {
        public Guid GUID;
        public string Name;
        public object Val;

        public Property(Guid guid, string name, object val)
        {
            GUID = guid;
            Name = name;
            Val = val;
        }
    }

    public interface IContentEnumerator : System.Runtime.InteropServices.ComTypes.IStream
    {
        HRESULT Init(string sUrl, string sUserAgent);
        void Terminate();
        void EnsureContent();

        string Url { get; }
        DateTime LastModified { get; }
        ulong Size { get; }
        string FilePath { get; }
        System.Runtime.InteropServices.ComTypes.IStream Content { get; }
        string ContentType { get; }
        string LaunchUrl { get; }
        string Title { get; }
        bool IsContainer { get; }
        byte[] SecurityDescriptor { get; }
        ArrayList Properties { get; }

        void ResetContainer();
        CrawlUrl CurrentContainer { get; }
        CrawlUrl GetNextContainer();

        void ResetItems();
        CrawlUrl CurrentItem { get; }
        CrawlUrl GetNextItem();
    }
}
